package com.ruoyi.web.exams.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.List;

/**
 * 题对象 exam_question
 *
 * @author 范书铭
 * @date 2024-10-02
 */
@ApiModel(value =  "题",description = "")
@TableName(resultMap = "com.ruoyi.web.exams.mapper.ExamQuestionMapper.ExamQuestionResult")
@Data
@EqualsAndHashCode(callSuper = true)
public class ExamQuestion extends BaseEntity{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    /** 题目分类 */
    @ApiModelProperty(name = "题目分类",notes = "")
    @Excel(name = "题目分类")
    private Long classification;

    /** 难度 */
    @ApiModelProperty(name = "难度",notes = "")
    @Excel(name = "难度")
    private Long difficulty;

    /** 试题标签 */
    @ApiModelProperty(name = "试题标签",notes = "")
    @Excel(name = "试题标签")
    private Long  questionTag;


    /** 题目 */
    @ApiModelProperty(name = "题目",notes = "")
    @Excel(name = "题目")
    private String title;

    /** 题目类型 */
    @ApiModelProperty(name = "题目类型 1:单选;2多选;3判断",notes = "")
    @Excel(name = "题目类型")
    private Long questionType;

    /** 讲义 */
    private String handout;

    /** 答题次数 */
    @ApiModelProperty(name = "答题次数",notes = "")
    @Excel(name = "答题次数")
    private Integer answerTimes;

    /** 答题正确次数 */
    @ApiModelProperty(name = "答题正确次数",notes = "")
    @Excel(name = "答题正确次数")
    private Integer answerRightTime;


    @TableField(exist = false)
    @ApiModelProperty(name = "用户答案对象", notes = "")
    private  ExamAnswers  examAnswers;

    @TableField(exist = false)
    @ApiModelProperty(name = "选项列表", notes = "")
    private  List<ExamOption>  options;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("title", getTitle())
                .append("questionType", getQuestionType())
                .append("handout", getHandout())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}